package com.wisnews.mapper.sec;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.wisnews.pojo.sec.entity.Operator;
import com.wisnews.pojo.sec.entity.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 系统角色 Mapper 接口
 * </p>
 *
 * @author yuyd
 * @since 2020-12-20
 */
@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    @Select("SELECT a.jurisdiction from t_sec_role a WHERE a.role_id = #{operatorRole}")
    String getJurisdiction(String operatorRole);

    @Select(" select * from t_sec_role ${ew.customSqlSegment}")
    IPage<Role> getRoleInfoPage(IPage<Operator> page,
                               @Param(Constants.WRAPPER) Wrapper<Operator> wrapper);
}
